<!--
 * @Author: coman
 * @LastEditors: coman
 * @Date: 2020-06-16 16:42:40
 * @motto: No pain,No gain
 * @LastEditTime: 2020-06-16 16:48:30
--> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!--  编写函数map(arr) 把数组中的每一位数字都增加30%，并返回一个新数组-->
    <script>
        function map(arr){
            // 新数组存储计算后的值
            var arr1= new Array();
            //遍历数组
            for(i=0;i<arr.length;i++){
                arr[i]=1.3*arr[i];
                arr1.push(arr[i]);
            }
            return arr1;
        }
        var arr=[10,100,1000];
        console.log(map(arr));
        
    </script>
</body>
</html>